import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
//导入node.js中的path
import path from 'path'
//按需导入 element-plus
/* import AutoImport from 'unplugin-auto-import/vite'
import Components from 'unplugin-vue-components/vite'
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers' */
import topLevelAwait from 'vite-plugin-top-level-await';

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [
	 vue(),
   topLevelAwait()
	//  AutoImport({
    //   resolvers: [ElementPlusResolver()],
    // }),
    // Components({
    //   resolvers: [ElementPlusResolver()],
    // }),
 ],

  resolve: {
		alias: {   //配置路径别名
			'@': path.resolve(__dirname, 'src'),
		},
	},
  server: {
    proxy: {
      '/api': 'http://localhost:8080'
    }
  },
})

